home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / texinfo / configure < prev    next >
Text File  |  1994-01-28  |  20KB  |  809 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=texi.texi
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122. if test -z "$CC"; then
  123.   # Extract the first word of `gcc', so it can be a program name with args.
  124.   set dummy gcc; word=$2
  125.   echo checking for $word
  126.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  127.   for dir in $PATH; do
  128.     test -z "$dir" && dir=.
  129.     if test -f $dir/$word; then
  130.       CC="gcc"
  131.       break
  132.     fi
  133.   done
  134.   IFS="$saveifs"
  135. fi
  136. test -z "$CC" && CC="cc"
  137. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  138.  
  139. # Find out if we are using GNU C, under whatever name.
  140. cat > conftest.c <<EOF
  141. #ifdef __GNUC__
  142.   yes
  143. #endif
  144. EOF
  145. ${CC-cc} -E conftest.c > conftest.out 2>&1
  146. if egrep yes conftest.out >/dev/null 2>&1; then
  147.   GCC=1 # For later tests.
  148. fi
  149. rm -f conftest*
  150.  
  151. echo checking how to run the C preprocessor
  152. if test -z "$CPP"; then
  153.   CPP='${CC-cc} -E'
  154.   cat > conftest.c <<EOF
  155. #include <stdio.h>
  156. EOF
  157. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  158. if test -z "$err"; then
  159.   :
  160. else
  161.   CPP=/lib/cpp
  162. fi
  163. rm -f conftest*
  164. fi
  165.  
  166. if test -n "$GCC"; then
  167.   echo checking whether -traditional is needed
  168.   pattern="Autoconf.*'x'"
  169.   prog='#include <sgtty.h>
  170. Autoconf TIOCGETP'
  171.   cat > conftest.c <<EOF
  172. $prog
  173. EOF
  174. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  175. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  176.   need_trad=1
  177. fi
  178. rm -f conftest*
  179.  
  180.  
  181.   if test -z "$need_trad"; then
  182.     prog='#include <termio.h>
  183. Autoconf TCGETA'
  184.     cat > conftest.c <<EOF
  185. $prog
  186. EOF
  187. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  188. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  189.   need_trad=1
  190. fi
  191. rm -f conftest*
  192.  
  193.   fi
  194.   test -n "$need_trad" && CC="$CC -traditional"
  195. fi
  196.  
  197. # Make sure to not get the incompatible SysV /etc/install and
  198. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  199. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  200. # or the AFS install, which mishandles nonexistent args, or
  201. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  202. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  203. # anyway.  Sigh.
  204. if test "z${INSTALL}" = "z" ; then
  205.   echo checking for install
  206.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  207.   for dir in $PATH; do
  208.     test -z "$dir" && dir=.
  209.     case $dir in
  210.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  211.     *)
  212.       if test -f $dir/installbsd; then
  213.     INSTALL="$dir/installbsd -c" # OSF1
  214.     INSTALL_PROGRAM='$(INSTALL)'
  215.     INSTALL_DATA='$(INSTALL) -m 644'
  216.     break
  217.       fi
  218.       if test -f $dir/install; then
  219.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  220.       : # AIX
  221.     else
  222.       INSTALL="$dir/install -c"
  223.       INSTALL_PROGRAM='$(INSTALL)'
  224.       INSTALL_DATA='$(INSTALL) -m 644'
  225.       break
  226.     fi
  227.       fi
  228.       ;;
  229.     esac
  230.   done
  231.   IFS="$saveifs"
  232. fi
  233. INSTALL=${INSTALL-cp}
  234. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  235. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  236.  
  237. if test -z "$RANLIB"; then
  238.   # Extract the first word of `ranlib', so it can be a program name with args.
  239.   set dummy ranlib; word=$2
  240.   echo checking for $word
  241.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  242.   for dir in $PATH; do
  243.     test -z "$dir" && dir=.
  244.     if test -f $dir/$word; then
  245.       RANLIB="ranlib"
  246.       break
  247.     fi
  248.   done
  249.   IFS="$saveifs"
  250. fi
  251. test -z "$RANLIB" && RANLIB=":"
  252. test -n "$RANLIB" -a -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  253.  
  254. echo checking for POSIXized ISC
  255. if test -d /etc/conf/kconfig.d &&
  256.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  257. then
  258.   ISC=1 # If later tests want to check for ISC.
  259.   {
  260. test -n "$verbose" && \
  261. echo '    defining' _POSIX_SOURCE
  262. DEFS="$DEFS -D_POSIX_SOURCE=1"
  263. }
  264.  
  265.   if test -n "$GCC"; then
  266.     CC="$CC -posix"
  267.   else
  268.     CC="$CC -Xp"
  269.   fi
  270. fi
  271.  
  272. echo checking for minix/config.h
  273. cat > conftest.c <<EOF
  274. #include <minix/config.h>
  275. EOF
  276. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  277. if test -z "$err"; then
  278.   MINIX=1
  279. fi
  280. rm -f conftest*
  281.  
  282. # The Minix shell can't assign to the same variable on the same line!
  283. if test -n "$MINIX"; then
  284.   {
  285. test -n "$verbose" && \
  286. echo '    defining' _POSIX_SOURCE
  287. DEFS="$DEFS -D_POSIX_SOURCE=1"
  288. }
  289.  
  290.   {
  291. test -n "$verbose" && \
  292. echo '    defining' _POSIX_1_SOURCE to be '2'
  293. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  294. }
  295.  
  296.   {
  297. test -n "$verbose" && \
  298. echo '    defining' _MINIX
  299. DEFS="$DEFS -D_MINIX=1"
  300. }
  301.  
  302. fi
  303.  
  304. prog='/* Ultrix mips cc rejects this.  */
  305. typedef int charset[2]; const charset x;
  306. /* SunOS 4.1.1 cc rejects this.  */
  307. char const *const *ccp;
  308. char **p;
  309. /* AIX XL C 1.02.0.0 rejects this.
  310.    It does not let you subtract one const X* pointer from another in an arm
  311.    of an if-expression whose if-part is not a constant expression */
  312. const char *g = "string";
  313. p = &g + (g ? g-g : 0);
  314. /* HPUX 7.0 cc rejects these. */
  315. ++ccp;
  316. p = (char**) ccp;
  317. ccp = (char const *const *) p;
  318. { /* SCO 3.2v4 cc rejects this.  */
  319.   char *t;
  320.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  321.  
  322.   *t++ = 0;
  323. }
  324. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  325.   int x[] = {25,17};
  326.   const int *foo = &x[0];
  327.   ++foo;
  328. }
  329. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  330.   typedef const int *iptr;
  331.   iptr p = 0;
  332.   ++p;
  333. }
  334. { /* AIX XL C 1.02.0.0 rejects this saying
  335.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  336.   struct s { int j; const int *ap[3]; };
  337.   struct s *b; b->j = 5;
  338. }'
  339. echo checking for working const
  340. cat > conftest.c <<EOF
  341.  
  342. int main() { exit(0); }
  343. int t() { $prog }
  344. EOF
  345. if eval $compile; then
  346.   :
  347. else
  348.   {
  349. test -n "$verbose" && \
  350. echo '    defining' const to be 'empty'
  351. DEFS="$DEFS -Dconst="
  352. }
  353.  
  354. fi
  355. rm -f conftest*
  356.  
  357. echo checking for ANSI C header files
  358. cat > conftest.c <<EOF
  359. #include <stdlib.h>
  360. #include <stdarg.h>
  361. #include <string.h>
  362. #include <float.h>
  363. EOF
  364. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  365. if test -z "$err"; then
  366.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  367. echo '#include <string.h>' > conftest.c
  368. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  369. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  370.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  371. cat > conftest.c <<EOF
  372. #include <ctype.h>
  373. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  374. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  375. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  376. int main () { int i; for (i = 0; i < 256; i++)
  377. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  378. exit (0); }
  379.  
  380. EOF
  381. eval $compile
  382. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  383.   {
  384. test -n "$verbose" && \
  385. echo '    defining' STDC_HEADERS
  386. DEFS="$DEFS -DSTDC_HEADERS=1"
  387. }
  388.  
  389. fi
  390. rm -f conftest*
  391. fi
  392. rm -f conftest*
  393.  
  394. fi
  395. rm -f conftest*
  396.  
  397. for hdr in unistd.h termio.h string.h varargs.h sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h
  398. do
  399. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  400. echo checking for ${hdr}
  401. cat > conftest.c <<EOF
  402. #include <${hdr}>
  403. EOF
  404. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  405. if test -z "$err"; then
  406.   {
  407. test -n "$verbose" && \
  408. echo '    defining' ${trhdr}
  409. DEFS="$DEFS -D${trhdr}=1"
  410. }
  411.  
  412. fi
  413. rm -f conftest*
  414. done
  415.  
  416. for func in setvbuf getcwd bzero rindex vfprintf vsprintf
  417. do
  418. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  419. echo checking for ${func}
  420. cat > conftest.c <<EOF
  421. #include <ctype.h>
  422. int main() { exit(0); }
  423. int t() { 
  424. /* The GNU C library defines this for functions which it implements
  425.     to always fail with ENOSYS.  Some functions are actually named
  426.     something starting with __ and the normal name is an alias.  */
  427. #if defined (__stub_${func}) || defined (__stub___${func})
  428. choke me
  429. #else
  430. /* Override any gcc2 internal prototype to avoid an error.  */
  431. extern char ${func}(); ${func}();
  432. #endif
  433.  }
  434. EOF
  435. if eval $compile; then
  436.   {
  437. test -n "$verbose" && \
  438. echo '    defining' ${trfunc}
  439. DEFS="$DEFS -D${trfunc}=1"
  440. }
  441.  
  442. fi
  443. rm -f conftest*
  444. done
  445.  
  446. echo checking for struct tm in time.h
  447. cat > conftest.c <<EOF
  448. #include <sys/types.h>
  449. #include <time.h>
  450. int main() { exit(0); }
  451. int t() { struct tm *tp; }
  452. EOF
  453. if eval $compile; then
  454.   :
  455. else
  456.   {
  457. test -n "$verbose" && \
  458. echo '    defining' TM_IN_SYS_TIME
  459. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  460. }
  461.  
  462. fi
  463. rm -f conftest*
  464.  
  465. cat > conftest.c <<EOF
  466. #include <stdio.h>
  467. main () {
  468.   /* If setvbuf has the reversed format, exit 0. */
  469.   if (setvbuf(stdout, _IOLBF, (char *) 0, BUFSIZ) != 0)/* The reversed way.  */
  470.     exit(1);
  471.   putc('\r', stdout);
  472.   exit(0);            /* Non-reversed systems segv here.  */
  473. }
  474. EOF
  475. eval $compile
  476. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  477.   {
  478. test -n "$verbose" && \
  479. echo '    defining' SETVBUF_REVERSED
  480. DEFS="$DEFS -DSETVBUF_REVERSED=1"
  481. }
  482.  
  483. fi
  484. rm -f conftest*
  485. rm -f core
  486.  
  487. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  488. # for constant arguments.  Useless!
  489. echo checking for working alloca.h
  490. cat > conftest.c <<EOF
  491. #include <alloca.h>
  492. int main() { exit(0); }
  493. int t() { char *p = alloca(2 * sizeof(int)); }
  494. EOF
  495. if eval $compile; then
  496.   {
  497. test -n "$verbose" && \
  498. echo '    defining' HAVE_ALLOCA_H
  499. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  500. }
  501.  
  502. fi
  503. rm -f conftest*
  504.  
  505. decl="#ifdef __GNUC__
  506. #define alloca __builtin_alloca
  507. #else
  508. #if HAVE_ALLOCA_H
  509. #include <alloca.h>
  510. #else
  511. #ifdef _AIX
  512.  #pragma alloca
  513. #else
  514. char *alloca ();
  515. #endif
  516. #endif
  517. #endif
  518. "
  519. echo checking for alloca
  520. cat > conftest.c <<EOF
  521. $decl
  522. int main() { exit(0); }
  523. int t() { char *p = (char *) alloca(1); }
  524. EOF
  525. if eval $compile; then
  526.   :
  527. else
  528.   alloca_missing=1
  529. cat > conftest.c <<EOF
  530.  
  531. #if defined(CRAY) && ! defined(CRAY2)
  532. winnitude
  533. #else
  534. lossage
  535. #endif
  536.  
  537. EOF
  538. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  539. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  540.   echo checking for _getb67
  541. cat > conftest.c <<EOF
  542. #include <ctype.h>
  543. int main() { exit(0); }
  544. int t() { 
  545. /* The GNU C library defines this for functions which it implements
  546.     to always fail with ENOSYS.  Some functions are actually named
  547.     something starting with __ and the normal name is an alias.  */
  548. #if defined (__stub__getb67) || defined (__stub____getb67)
  549. choke me
  550. #else
  551. /* Override any gcc2 internal prototype to avoid an error.  */
  552. extern char _getb67(); _getb67();
  553. #endif
  554.  }
  555. EOF
  556. if eval $compile; then
  557.   {
  558. test -n "$verbose" && \
  559. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  560. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  561. }
  562.  
  563. else
  564.   echo checking for GETB67
  565. cat > conftest.c <<EOF
  566. #include <ctype.h>
  567. int main() { exit(0); }
  568. int t() { 
  569. /* The GNU C library defines this for functions which it implements
  570.     to always fail with ENOSYS.  Some functions are actually named
  571.     something starting with __ and the normal name is an alias.  */
  572. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  573. choke me
  574. #else
  575. /* Override any gcc2 internal prototype to avoid an error.  */
  576. extern char GETB67(); GETB67();
  577. #endif
  578.  }
  579. EOF
  580. if eval $compile; then
  581.   {
  582. test -n "$verbose" && \
  583. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  584. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  585. }
  586.  
  587. else
  588.   echo checking for getb67
  589. cat > conftest.c <<EOF
  590. #include <ctype.h>
  591. int main() { exit(0); }
  592. int t() { 
  593. /* The GNU C library defines this for functions which it implements
  594.     to always fail with ENOSYS.  Some functions are actually named
  595.     something starting with __ and the normal name is an alias.  */
  596. #if defined (__stub_getb67) || defined (__stub___getb67)
  597. choke me
  598. #else
  599. /* Override any gcc2 internal prototype to avoid an error.  */
  600. extern char getb67(); getb67();
  601. #endif
  602.  }
  603. EOF
  604. if eval $compile; then
  605.   {
  606. test -n "$verbose" && \
  607. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  608. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  609. }
  610.  
  611. fi
  612. rm -f conftest*
  613.  
  614. fi
  615. rm -f conftest*
  616.  
  617. fi
  618. rm -f conftest*
  619.  
  620. fi
  621. rm -f conftest*
  622.  
  623.  
  624. fi
  625. rm -f conftest*
  626.  
  627. if test -n "$alloca_missing"; then
  628.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  629.   # that cause trouble.  Some versions do not even contain alloca or
  630.   # contain a buggy version.  If you still want to use their alloca,
  631.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  632.   ALLOCA=alloca.o
  633.  
  634.   echo 'checking stack direction for C alloca'
  635.   echo checking whether cross-compiling
  636. # If we cannot run a trivial program, we must be cross compiling.
  637. cat > conftest.c <<EOF
  638. main(){exit(0);}
  639. EOF
  640. eval $compile
  641. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  642.   :
  643. else
  644.   cross_compiling=1
  645. fi
  646. rm -f conftest*
  647.  
  648. if test -n "$cross_compiling"
  649. then
  650.   {
  651. test -n "$verbose" && \
  652. echo '    defining' STACK_DIRECTION to be '0'
  653. DEFS="$DEFS -DSTACK_DIRECTION=0"
  654. }
  655.  
  656. else
  657. cat > conftest.c <<EOF
  658. find_stack_direction ()
  659. {
  660.   static char *addr = 0;
  661.   auto char dummy;
  662.   if (addr == 0)
  663.     {
  664.       addr = &dummy;
  665.       return find_stack_direction ();
  666.     }
  667.   else
  668.     return (&dummy > addr) ? 1 : -1;
  669. }
  670. main ()
  671. {
  672.   exit (find_stack_direction() < 0);
  673. }
  674. EOF
  675. eval $compile
  676. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  677.   {
  678. test -n "$verbose" && \
  679. echo '    defining' STACK_DIRECTION to be '1'
  680. DEFS="$DEFS -DSTACK_DIRECTION=1"
  681. }
  682.  
  683. else
  684.   {
  685. test -n "$verbose" && \
  686. echo '    defining' STACK_DIRECTION to be '-1'
  687. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  688. }
  689.  
  690. fi
  691. fi
  692. rm -f conftest*
  693. fi
  694.  
  695. TERMLIBS=""
  696. for termlib in termcap terminfo curses termlib ; do
  697.    LIBS_save="${LIBS}"
  698. LIBS="${LIBS} -l${termlib}"
  699. have_lib=""
  700. echo checking for -l${termlib}
  701. cat > conftest.c <<EOF
  702.  
  703. int main() { exit(0); }
  704. int t() { main(); }
  705. EOF
  706. if eval $compile; then
  707.   have_lib="1"
  708. fi
  709. rm -f conftest*
  710. LIBS="${LIBS_save}"
  711. if test -n "${have_lib}"; then
  712.    :; TERMLIBS="${TERMLIBS} -l${termlib}"
  713. else
  714.    :; 
  715. fi
  716.  
  717.    case "${TERMLIBS}" in
  718.       *-l${termlib}* ) break ;;
  719.    esac
  720. done
  721.  
  722. if test -n "$prefix"; then
  723.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  724.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  725. fi
  726. if test -n "$exec_prefix"; then
  727.   prsub="$prsub
  728. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  729. exec_prefix\\1=\\2$exec_prefix%"
  730. fi
  731. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  732.  
  733. trap 'rm -f config.status; exit 1' 1 3 15
  734. echo creating config.status
  735. rm -f config.status
  736. cat > config.status <<EOF
  737. #!/bin/sh
  738. # Generated automatically by configure.
  739. # Run this file to recreate the current configuration.
  740. # This directory was configured as follows,
  741. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  742. #
  743. # $0 $*
  744.  
  745. for arg
  746. do
  747.   case "\$arg" in
  748.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  749.     exec /bin/sh $0 $* ;;
  750.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  751.   esac
  752. done
  753.  
  754. trap 'rm -f Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile; exit 1' 1 3 15
  755. CC='$CC'
  756. CPP='$CPP'
  757. INSTALL='$INSTALL'
  758. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  759. INSTALL_DATA='$INSTALL_DATA'
  760. RANLIB='$RANLIB'
  761. ALLOCA='$ALLOCA'
  762. TERMLIBS='$TERMLIBS'
  763. LIBS='$LIBS'
  764. srcdir='$srcdir'
  765. DEFS='$DEFS'
  766. prefix='$prefix'
  767. exec_prefix='$exec_prefix'
  768. prsub='$prsub'
  769. EOF
  770. cat >> config.status <<\EOF
  771.  
  772. top_srcdir=$srcdir
  773.  
  774. # Allow make-time overrides of the generated file list.
  775. test -n "$gen_files" || gen_files="Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile"
  776.  
  777. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  778.   srcdir=$top_srcdir
  779.   # Remove last slash and all that follows it.  Not all systems have dirname.
  780.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  781.   if test "$dir" != "$file"; then
  782.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  783.     test ! -d $dir && mkdir $dir
  784.   fi
  785.   echo creating $file
  786.   rm -f $file
  787.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  788.   sed -e "
  789. $prsub
  790. s%@CC@%$CC%g
  791. s%@CPP@%$CPP%g
  792. s%@INSTALL@%$INSTALL%g
  793. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  794. s%@INSTALL_DATA@%$INSTALL_DATA%g
  795. s%@RANLIB@%$RANLIB%g
  796. s%@ALLOCA@%$ALLOCA%g
  797. s%@TERMLIBS@%$TERMLIBS%g
  798. s%@LIBS@%$LIBS%g
  799. s%@srcdir@%$srcdir%g
  800. s%@DEFS@%$DEFS%
  801. " $top_srcdir/${file}.in >> $file
  802. fi; done
  803.  
  804. exit 0
  805. EOF
  806. chmod +x config.status
  807. test -n "$no_create" || ./config.status
  808.  
  809.